class ItemAttributeSetsController < ApplicationController
  # GET /item_attribute_sets
  # GET /item_attribute_sets.json
  def index
    @item_attribute_sets = ItemAttributeSet.all

    respond_to do |format|
      format.html # index.html.erb
      format.json  { render :json => @item_attribute_sets }
    end
  end

  # GET /item_attribute_sets/1
  # GET /item_attribute_sets/1.json
  def show
    @item_attribute_set = ItemAttributeSet.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.json  { render :json => @item_attribute_set }
    end
  end

  # GET /item_attribute_sets/new
  # GET /item_attribute_sets/new.json
  def new
    @item_attribute_set = ItemAttributeSet.new

    respond_to do |format|
      format.html # new.html.erb
      format.json  { render :json => @item_attribute_set }
    end
  end

  # GET /item_attribute_sets/1/edit
  def edit
    @item_attribute_set = ItemAttributeSet.find(params[:id])
  end

  # POST /item_attribute_sets
  # POST /item_attribute_sets.json
  def create
    @item_attribute_set = ItemAttributeSet.new(params[:item_attribute_set])

    respond_to do |format|
      if @item_attribute_set.save
        flash[:notice] = 'ItemAttributeSet was successfully created.'
        format.html { redirect_to(@item_attribute_set) }
        format.json  { render :json => @item_attribute_set, :status => :created, :location => @item_attribute_set }
      else
        format.html { render :action => "new" }
        format.json  { render :json => @item_attribute_set.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /item_attribute_sets/1
  # PUT /item_attribute_sets/1.json
  def update
    @item_attribute_set = ItemAttributeSet.find(params[:id])

    respond_to do |format|
      if @item_attribute_set.update_attributes(params[:item_attribute_set])
        flash[:notice] = 'ItemAttributeSet was successfully updated.'
        format.html { redirect_to(@item_attribute_set) }
        format.json  { head :ok }
      else
        format.html { render :action => "edit" }
        format.json  { render :json => @item_attribute_set.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /item_attribute_sets/1
  # DELETE /item_attribute_sets/1.json
  def destroy
    @item_attribute_set = ItemAttributeSet.find(params[:id])
    @item_attribute_set.destroy

    respond_to do |format|
      format.html { redirect_to(item_attribute_sets_url) }
      format.json  { head :ok }
    end
  end
end
